CREATE TABLE [dbo].[TTRENC_ANUL]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_UNID_CONC] [dbo].[TD_VC_003] NOT NULL,
[CO_CLIE] [dbo].[TD_VC_020] NOT NULL,
[NU_RENO] [dbo].[TD_VC_008] NOT NULL,
[FE_RENO] [dbo].[TD_DT_001] NOT NULL,
[FE_ANUL] [dbo].[TD_DT_001] NOT NULL,
[CO_TIPO_OPER] [dbo].[TD_VC_003] NOT NULL,
[ST_CONT] [dbo].[TD_VC_001_INTE] NOT NULL CONSTRAINT [DF__TTRENC_AN__ST_CO__61274A53] DEFAULT ('N'),
[NU_PROC] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TTRENC_AN__NU_PR__630F92C5] DEFAULT ((0)),
[NU_ASTO] [dbo].[TD_VC_010] NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TTRENC_AN__CO_US__6403B6FE] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTRENC_AN__FE_US__64F7DB37] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TTRENC_AN__CO_US__65EBFF70] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTRENC_AN__FE_US__66E023A9] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTRENC_ANUL] WITH NOCHECK ADD CONSTRAINT [CK__TTRENC_AN__ST_CO__621B6E8C] CHECK NOT FOR REPLICATION (([ST_CONT]='P' OR [ST_CONT]='N'))
GO
ALTER TABLE [dbo].[TTRENC_ANUL] ADD CONSTRAINT [PK__TTRENC_A__4D074D6F7385F1B0] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_UNID_CONC], [CO_CLIE], [NU_RENO], [FE_RENO]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTRENC_ANUL] ADD CONSTRAINT [FK__TTRENC_ANUL__6680FC4D] FOREIGN KEY ([CO_EMPR], [CO_TIPO_OPER]) REFERENCES [dbo].[TTTIPO_OPER] ([CO_EMPR], [CO_TIPO_OPER])
GO
ALTER TABLE [dbo].[TTRENC_ANUL] ADD CONSTRAINT [FK__TTRENC_ANUL__67752086] FOREIGN KEY ([CO_EMPR], [CO_UNID_CONC], [CO_CLIE], [NU_RENO], [FE_RENO]) REFERENCES [dbo].[TCRENO_CLIE] ([CO_EMPR], [CO_UNID_CONC], [CO_CLIE], [NU_RENO], [FE_RENO])
GO
